1. Field of the Invention
The present invention relates to a microcomputer having a fuzzy operation function.
2. Description of Related Art
In the case of controlling some object to some set value, a fuzzy inference has been known in which, at which degree a current measured value is adaptive to a plurality of conditions is discriminated, and a controlled manipulated variable is inferred on the basis of the discrimination. Here, these conditions can have vague expressions.
General fuzzy inference includes a Max-Min method Here, assuming that a difference between a set value and a measured value is E, a change component during one sampling period is .DELTA.E, and a manipulated variable at this time is .DELTA.U, control is performed in accordance with the following three rules:
RULE 1: If E is negative and slightly large and if .DELTA.E.apprxeq.0, .DELTA.U is positive and slightly large. PA1 RULE 2: If E.apprxeq.0, and if .DELTA.E is positive and slightly large, .DELTA.U is negative and slightly large. PA1 RULE 3: If E.apprxeq.0, and if .DELTA.E.apprxeq.0, .DELTA.U.apprxeq.0.
Under this condition, a method for determining the manipulated variable .DELTA.U in accordance with the Max-Min method will be described with reference to FIG. 1. In all graphs shown in FIG. 1, the axis of ordinates shows the adaptivity degree .mu. for the fuzzy set. This adaptivity degree .mu. is indicative of the degree by which the elements (E, .DELTA.E, .DELTA.U) belong to the fuzzy set. If the elements completely belongs to the fuzzy set, .mu.=1. If the elements do not belong to the fuzzy set at all, .mu.=0.
Graphs 3-11 and 3-23 are a fuzzy set in which E is negative and slightly large. Graphs 3-12, 3-21, 3-31, 3-32 and 3-33 are a fuzzy set in which E is almost 0, and graphs 3-13 and 3-22 are a fuzzy set in which E is positive and slightly large.
In addition, the graphs 3-11, 3-12 and 3-13 indicate the conditions E and .DELTA.E and the manipulated variable .DELTA.U for RULE 1. The graphs 3-21, 3-22 and 3-23 indicate the conditions E and .DELTA.E and the manipulated variable .DELTA.U for RULE 2, and the graphs 3-31, 3-32 and 3-33 indicate the conditions E and .DELTA.E and the manipulated variable .DELTA.U for RULE 3.
If the fuzzy set of RULE 1 is that E is negative and slightly large (Graph 3-11) and .DELTA.E is almost 0 (Graph 3-12), .DELTA.U should be made positive and slightly large (Graph 3-13).
Here, the set "negative and slightly large" will be explained with reference to an example having numeral values (-5, -4, -3, -2, -1). By partitioning the adaptivity degree .mu. and the element by "/", the fuzzy set F can be expressed: F=(0.2/-5, 0.5/-4, 1/-3, 0.5/-2, 0.2/-1). It is a matter of course that, when the adaptivity degree .mu. is handled by a microcomputer, these values are suitably normalized into a binary code for easy controlling.
The data group of the fuzzy set has a structure in which these elements are converted into an address on a memory, and the adaptivity degree .mu. of the elements is stored as dam in the memory.
Now, it is assumed that E=X1 and .DELTA.E=X2 are obtained from the measured result. First, the adaptivity degree .mu.11 of RULE 1 to the difference E and the adaptivity degree .mu.12 of RULE 1 to .DELTA.E are obtained, and a smaller one will be regarded as the conformity degree for RULE 1. Next, the fuzzy set of .DELTA.U is made under this conformity degree (the hatched zone in Graph 3-13).
Similarly, the conformity degree for RULE 2 and the conformity degree for RULE 3 are sought, and the fuzzy set of .DELTA.U is made under the obtained conformity degrees (the hatched zone in Graphs 3-23 and 3-33).
Thereafter, an OR set (Graph 3-4) for the obtained sets for .DELTA.U (the hatched zone in Graphs 3-13, 3-23 and 3-33) is sought. This is a fuzzy set for the manipulated variable for all RULE 1, RULE 2 and RULE 3. Furthermore, by obtaining a weight point of this set (Graph 3-4), manipulated variable to be actually operated at this time can be obtained.
If the above mentioned operation is performed in a software manner, it is necessary that the adaptivity of the rules to the difference E, the adaptivity of the rules to .DELTA.E, and tit adaptivity of the rules to .DELTA.E are previously stored in respective addresses in the memory corresponding to E, .DELTA.E and .DELTA.U, and all zero is stored in a result storing area (Graph 3-4) as an initial value.
Step (1) From the address corresponding to X1 and X2, the adaptivity of RULE 1 to the difference E and the adaptivity of RULE 1 to .DELTA.E are obtained, and then, compared with each other, so as to select a smaller one as the conformity degree for RULE 1.
Step (2) Data in the data group storing the adaptivity degree for .DELTA.U is compared with the conformity degree obtained in the step (1), and a smaller one is stored in a temporary register (not shown).
Step (3) The value of the temporary register is compared with data stored in the result storing area (Graph 3-4), and a larger one is stored in the result storing area (Graph 3-4).
Step (4) The above steps (2) and (3) are repeated in a looped processing the times corresponding to the number of data. The hatched zone in Graph 3-13 is determined by these processings.
Step (5) The above steps (1) to (4) are performed for RULE 2. With this, the OR set of the hatched zone in Graph 3-13 and the hatched zone in Graph 3-23 is obtained.
Step (6) Similarly, for RULE 3, the above steps (1) to (4) are performed. With this, the OR set (Graph 3-4) of the hatched zone in Graph 3-13, the hatched zone in Graph 3-23 and the hatched zone in Graph 3-33 is obtained.
Step (7) For the OR set (Graph 3-4) obtained in the step (6), a weight point is calculated, so that an actual manipulated variable is obtained.
In the case that the manipulated variable is sought by using the Max-Min method as mentioned above, if the processing is executed by use of only existing instructions in a software manner, a very long time has been required because of branching processings caused by the looped processings.
In addition, a high speed fuzzy chip for exclusively executing the fuzzy inference has been developed, but it is very expensive.